.sw-grid {
    display: grid;
    overflow: hidden;
    position: relative;
    grid-template-rows: auto;
    border: 1px solid var(--color-border-secondary-default);
    border-radius: var(--border-radius-card);

    &.sw-grid--sidebar {
        grid-template-columns: 1fr auto;
    }

    &.sw-grid--fullpage {
        width: 100%;
        height: 100%;
        position: absolute;
        border: 0 none;
    }

    &.sw-grid--table {
        border: 0 none;

        .sw-grid__header {
            background: 0 none;
        }

        .sw-grid-row {
            &.is--selected {
                background-color: var(--color-background-brand-default);
            }

            &.is--deleted {
                background-color: var(--color-background-critical-default);
            }

            &.is--new {
                background-color: var(--color-background-positive-default);
            }
        }

        .sw-empty-state {
            position: relative;
        }

        .sw-grid-column {
            border-right: 0 none;
        }
    }

    .sw-grid__content {
        display: grid;
        grid-template-rows: auto;

        &.sw-grid__content--header {
            grid-template-rows: var(--scale-size-64) 1fr;
        }

        &.sw-grid__content--pagination {
            grid-template-rows: 1fr var(--scale-size-64);
        }

        &.sw-grid__content--header.sw-grid__content--pagination {
            grid-template-rows: var(--scale-size-64) 1fr auto;
        }
    }

    .sw-grid__header {
        display: grid;
        grid-auto-flow: column;
        background: var(--color-elevation-surface-raised);
        border-bottom: 1px solid var(--color-border-secondary-default);

        .sw-grid-column {
            font-size: var(--font-size-xs);
            font-weight: var(--font-weight-semibold);

            .sw-grid__cell-content {
                color: var(--color-text-primary-default);
            }

            &.is--sortable {
                cursor: pointer;
            }

            &.is--sorted .sw-grid__cell-content {
                color: var(--color-text-secondary-default);
                display: grid;
                grid-template-columns: 1fr var(--scale-size-10);
                grid-gap: var(--scale-size-4);
            }
        }

        .sw-grid__cell-label {
            max-width: 100%;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sw-grid_cell-sortable {
            .icon--regular-chevron-down-xxs {
                padding: var(--scale-size-4);
            }
        }
    }

    .sw-grid__body {
        justify-self: stretch;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sw-grid__action-button {
        background: none;
        border: none;
        cursor: pointer;
        outline: none;
        font-size: var(--font-size-l);
        color: var(--color-icon-primary-default);

        &:hover {
            color: var(--color-interaction-primary-hover);
        }
    }

    .sw-grid__pagination {
        background: var(--color-background-secondary-default);
    }

    .sw-grid__cell-content {
        color: var(--color-text-primary-default);

        .sw-media-field {
            margin-bottom: 0;
        }

        .sw-media-field-picker .sw-simple-search-field {
            margin-bottom: var(--scale-size-14);
        }
    }

    .mt-field--checkbox,
    .mt-field {
        margin-bottom: 0;
    }
}
